package com.estacionamientos

class ImagenController {

	def viewImage = {
		def image = Imagen.get(params.id)
		byte[] photo = image.getMyFile()
		// To load an image from a buffer
		def imageTool = new ImageTool()
		imageTool.load(photo)
		imageTool.thumbnail(300)
		
		response.outputStream << imageTool.getBytes("JPEG")
	}
	
}
